-----------------------------------
-- Area: Aht Urhgan Whitegate
--  NPC: Zabahf
-- Type: Standard NPC
-- !pos -90.070 -1 10.140 50
-----------------------------------
package.loaded["scripts/zones/Aht_Urhgan_Whitegate/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/zones/Aht_Urhgan_Whitegate/TextIDs");
-----------------------------------

function onTrade(player,npc,trade)
end;

function onTrigger(player,npc)
    local gotItAllProg = player:getVar("gotitallCS");
    if (gotItAllProg == 1 or gotItAllProg == 3) then
        player:startEvent(533);
    elseif (gotItAllProg == 2) then
        player:startEvent(523);
    elseif (gotItAllProg == 5) then
        player:startEvent(538);
    elseif (gotItAllProg == 6) then
        player:startEvent(540);
    elseif (gotItAllProg == 7) then
        player:startEvent(535);
    elseif (player:getQuestStatus(AHT_URHGAN,GOT_IT_ALL) == QUEST_COMPLETED) then
        player:startEvent(530);
    end
end;

function onEventUpdate(player,csid,option)
end;

function onEventFinish(player,csid,option)
    if (csid == 523) then
        player:setVar("gotitallCS",3);
    end
end;